package com.kitty.spring.annotationdriven.aop;

import org.aspectj.lang.annotation.*;

/**
 * @Description
 * @Author SHEN
 * @Date 2020/12/8
 */

@Aspect
public class MyAspect {


    @Pointcut("execution(public int com.kitty.spring.annotationdriven.aop.MyCalculator.div(..))")
    public void pointCut(){

    }

    @Before("pointCut()")
    public void aspectLogBefore(){
        System.out.println("除法开始=====");
    }

    @After("pointCut()")
    public void aspectLogAfter(){
        System.out.println("除法结束=====");
    }

    @AfterReturning("pointCut()")
    public void aspectLogReturn(){
        System.out.println("除法返回======");
    }



    @AfterThrowing("pointCut()")
    public void aspectLogThrowing(){
        System.out.println("触发异常======");
    }

    /*@Around("pointCut()")
    public void aspectLogAround(){
        System.out.println("方法环绕=====");
    }*/

}
